<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 隐式转换
    let a = 10;
    let b = "20";
    console.log(a + b);  //1020，字符串
    console.log(b - a);  //10，数字
    console.log(+'123');  //123，数字
    console.log(+'11'+11); //22，数字
    console.log(+'11'+'11'); //1111，字符串

    // 显示转换
    let c = "123";
    console.log(Number(c));  //123，数字
    console.log(Number('pink'));  //NaN

    console.log(parseInt('123px'));  //123，数字
    console.log(parseInt('abc123.45px'));  //NaN

    console.log(parseFloat('123.45px'));  //123.45，数字
    console.log(parseFloat('123.45.67px'));  //123.45，数字
    console.log(parseFloat('abc123.45px'));  //NaN

    
    
    
  </script>
</body>
</html>